<?php
namespace App\Libs\ClassLibs;
use \Phalcon\DI;
use \App\Libs\Cache\Redis;
use \App\Libs\DB\JiaPdo;
use App\Models\Goods\Goods;
/**
 * 班级类
 */
class ClassLibs extends \App\Libs\Base\AccessObject
{
	/**
	*	悬赏班排行
	*/
	public static function offerRank( $params ){
		$limit = $params['offset'].','.$params['size'];
		$sql = "SELECT classc.id,classc.class_name,classc.class_icon,sum(card_num) scardnum FROM `t_jia_class` classc LEFT JOIN t_jia_class_apply apply ON classc.id = apply.cid WHERE classc.class_type = 2 GROUP BY classc.id ORDER by scardnum DESC limit ".$limit;
		$result = JiaPdo::findAll( $sql );
		return $result;
	}
	

}


